import axios from 'axios'
const SERVER = 'http://localhost:5188'

export default function post(url, params) {
  return new Promise(resolve=>{
    axios.post(SERVER + url, params).then(res=>{
      const data = res.data; // 服务返回的数据
      resolve(data);
    }).catch((e)=> { // 捕获
      resolve({ message: '网络错误' });
    })
  });
}